﻿// DigitalDesign
// Project: InformationBoard
// Developer: Syzdykov Sergey
// Created: 09.11.2011
// Last change: 11.11.2011
// Description: class for sending on the client

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace Server
{
    [DataContract]
    public class StationNotEF
    {
        [DataMember]
        public int Id { get; private set; }
        [DataMember]
        public string Name { get; set; }
        [DataMember]
        public string Address { get; set; }
        [DataMember]
        public List<LocationNotEF> LocationsNotEF { get; set; }

        public StationNotEF(Station station)
        {
            Id = station.Id;
            Name = station.Name;
            Address = station.Address;
            LocationsNotEF = new List<LocationNotEF>();

            if (station.Locations.Count != 0)
            {
                foreach (var location in station.Locations)
                {
                    LocationsNotEF.Add(new LocationNotEF(location));
                }
            }
        }

        public StationNotEF()
        {
            LocationsNotEF = new List<LocationNotEF>();
        }
    }
}
